package ex104;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Triangle triangle = new Triangle();

        System.out.print("输入三角形第1个顶点横坐标和纵坐标(用空格分隔): ");
        triangle.x1 = scanner.nextDouble();
        triangle.y1 = scanner.nextDouble();
        System.out.print("输入三角形第2个顶点横坐标和纵坐标(用空格分隔): ");
        triangle.x2 = scanner.nextDouble();
        triangle.y2 = scanner.nextDouble();
        System.out.print("输入三角形第3个顶点横坐标和纵坐标(用空格分隔): ");
        triangle.x3 = scanner.nextDouble();
        triangle.y3 = scanner.nextDouble();

        System.out.printf("面积: %.2f\n", triangle.getArea());
    }
}
